/**
 * Copyright (c) 2017-present, Facebook, Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

const React = require('react');

class Footer extends React.Component {
  docUrl(doc, language) {
    const baseUrl = this.props.config.baseUrl;
    return baseUrl + 'docs/' + (language ? language + '/' : '') + doc;
  }

  pageUrl(doc, language) {
    const baseUrl = this.props.config.baseUrl;
    return baseUrl + (language ? language + '/' : '') + doc;
  }

  render() {
    const currentYear = new Date().getFullYear();
    return (
      <footer className="nav-footer" id="footer">
        <section className="sitemap">
          <a href={this.props.config.baseUrl} className="nav-home">
            {this.props.config.footerIcon && (
              <img
                src={this.props.config.baseUrl + this.props.config.footerIcon}
                alt={this.props.config.title}
                width="66"
                height="58"
              />
            )}
          </a>
          <div>
            <h5>Docs</h5>
            <a href={this.docUrl('getting-started.html')}>Getting Started</a>
            <a href={this.docUrl('resources.html')}>Learning Resources</a>
            <a href={this.docUrl('credits.html')}>Credits</a>
          </div>
          <div>
            <h5>More</h5>
            <a href="https://github.com/software-mansion/react-native-gesture-handler">
              GitHub
            </a>
            <a href="https://github.com/software-mansion/react-native-gesture-handler/issues">
              Issues
            </a>
            <a
              className="github-button"
              href={this.props.config.repoUrl}
              data-icon="octicon-star"
              data-count-href="/software-mansion/react-native-gesture-handler"
              data-show-count={true}
              data-count-aria-label="# stargazers on GitHub"
              aria-label="Star this project on GitHub">
              Star
            </a>
          </div>
        </section>

        <div className="logos">
          <a
            href="https://expo.io"
            target="_blank"
            rel="noreferrer noopener"
            title="Expo"
            className="logo">
            <svg
              xmlns="http://www.w3.org/2000/svg"
              width="28"
              viewBox="0 0 24 22">
              <path
                fill="white"
                d="M5.84439563e-15,18.52072 C0.042601976,19.0415198 0.225318565,19.5638181 0.704130384,20.2650123 C1.27202197,21.0966169 2.24914731,21.5536071 2.9619004,20.8204258 C3.44287509,20.3256353 8.643748,11.2343287 11.1501969,7.78933904 C11.4511295,7.3640867 12.0728268,7.3640867 12.3739317,7.78933904 C14.8803807,11.2343287 20.0812536,20.3256353 20.5622283,20.8204258 C21.2748089,21.5536071 22.2521067,21.0966169 22.8199983,20.2650123 C23.3790947,19.4462456 23.5343035,18.8713971 23.5343035,18.2580353 C23.5343035,17.8402716 15.4344759,2.76636898 14.6187677,1.5116517 C13.8343003,0.304828919 13.5946623,0.042335452 12.268059,0 L11.2560275,1.79395598e-12 C9.92932506,0.042335452 9.68981105,0.304828919 8.90518853,1.5116517 C8.10659328,2.74030565 0.3230204,17.219996 0,18.213285 L5.84439563e-15,18.52072 Z"
              />
            </svg>
            <svg
              fill="white"
              width="50"
              style={{ margin: '4px 0 0 8px' }}
              viewBox="0 0 50 22">
              <path d="M0.583491239,16.0324821 L0.583491239,0.578259454 L10.0431199,0.578259454 L10.0431199,3.33803123 L3.46623518,3.33803123 L3.46623518,6.80406065 L9.44522132,6.80406065 L9.44522132,9.45346295 L3.46623518,9.45346295 L3.46623518,13.2728887 L10.0431199,13.2728887 L10.0431199,16.0324821 L0.583491239,16.0324821 Z M12.2294939,16.0324821 L16.1585173,9.98337907 L12.4643765,4.3315348 L15.3471204,4.3315348 L17.8880602,8.26132998 L17.9308288,8.26132998 L20.4719411,4.3315348 L23.3545126,4.3315348 L19.6603717,9.98337907 L23.5893951,16.0324821 L20.6212864,16.0324821 L17.9308288,11.8379072 L17.8880602,11.8379072 L15.1976027,16.0324821 L12.2294939,16.0324821 Z M25.7247227,21 L25.7247227,4.3315348 L28.372584,4.3315348 L28.372584,5.4573391 L28.4153527,5.4573391 L28.5221018,5.29187404 C28.5648704,5.22554537 28.6750687,5.11160984 28.8530414,4.94971084 C29.0310141,4.78763353 29.2267496,4.64053367 29.4402478,4.50805464 C29.6537461,4.37557561 29.9420895,4.25789572 30.3051055,4.15483666 C30.6681215,4.0517776 31.055971,4.00024807 31.4688262,4.00024807 C32.8070706,4.00024807 33.977862,4.55583981 34.9815453,5.66720158 C35.9850561,6.77838504 36.4868977,8.28326124 36.4868977,10.1820085 C36.4868977,12.0953765 36.0028189,13.6039971 35.0348336,14.7078701 C34.0668483,15.8117432 32.8924354,16.3637689 31.5115949,16.3637689 C31.0987396,16.3637689 30.7179608,16.3122393 30.369086,16.2091803 C30.0203837,16.1061212 29.7392834,15.984697 29.5257851,15.8449075 C29.3121144,15.7051181 29.127071,15.5653286 28.9704827,15.4253609 C28.8138943,15.2855714 28.7000745,15.1641472 28.6288509,15.0610881 L28.5434861,14.9066778 L28.5007175,14.9066778 L28.5007175,21 L25.7247227,21 Z M28.5007175,8.96776594 L28.5007175,11.3741414 C28.5007175,12.0513357 28.7214588,12.6215483 29.1627691,13.0851357 C29.6040793,13.5489015 30.1947348,13.7806952 30.9350806,13.7806952 C31.7464775,13.7806952 32.4119781,13.4715181 32.9315825,12.853342 C33.451187,12.235166 33.7109029,11.3447215 33.7109029,10.1820085 C33.7109029,9.01929547 33.4548085,8.12885095 32.9422747,7.51067492 C32.4297409,6.89249888 31.7606187,6.5833217 30.9350806,6.5833217 C30.1947348,6.5833217 29.6040793,6.81511543 29.1627691,7.27888119 C28.7214588,7.74246864 28.5007175,8.30537079 28.5007175,8.96776594 Z M43.7042773,16.3637689 C42.1668483,16.3637689 40.9,15.8192319 39.9033873,14.7299797 C38.9069471,13.6409058 38.408727,12.1247965 38.408727,10.1820085 C38.408727,8.2686404 38.9212608,6.76001985 39.946156,5.6561468 C40.9710511,4.55227375 42.2239307,4.00024807 43.7042773,4.00024807 C45.1847964,4.00024807 46.4375035,4.55227375 47.4625711,5.6561468 C48.4874662,6.76001985 49,8.2686404 49,10.1820085 C49,12.1247965 48.5017799,13.6409058 47.5053397,14.7299797 C46.508727,15.8192319 45.2418787,16.3637689 43.7042773,16.3637689 Z M43.7042773,13.7806952 C44.5015329,13.7806952 45.1278865,13.467952 45.5835104,12.8422872 C46.0389619,12.2168008 46.2667738,11.3301006 46.2667738,10.1820085 C46.2667738,9.03391631 46.0355128,8.14721615 45.5728182,7.52172969 C45.1101237,6.89606493 44.4873917,6.5833217 43.7042773,6.5833217 C42.9213353,6.5833217 42.2986033,6.89249888 41.8359088,7.51067492 C41.3732142,8.12885095 41.1419532,9.01929547 41.1419532,10.1820085 C41.1419532,11.3447215 41.3697652,12.235166 41.8252166,12.853342 C42.2808406,13.4715181 42.9071941,13.7806952 43.7042773,13.7806952 Z" />
            </svg>
          </a>
          <a
            href="https://swmansion.com"
            target="_blank"
            rel="noreferrer noopener"
            title="Expo"
            className="logo">
            <svg height="28" viewBox="0 0 8000 1000">
              <polyline
                fill="#F2F2F2"
                points="500 0, 933 250, 933 750, 824.75 812.5, 824.75 437.5, 500 625, 175.25 437.5, 175.25 500, 500 687.5, 770.625  531.25, 770.625 843.75, 500 1000, 67 750, 67 625, 500 875, 662.375 781.25, 662.375 718.75, 500 812.5, 67 562.5, 67 250 "
                data-reactid="8"
              />
              <polyline
                fill="#F6F6F6"
                points=" 500 500 500 625, 824.75 437.5, 824.75 812.5, 933 750, 933 250"
                data-reactid="9"
              />
              <polyline
                fill="#F6F6F6"
                points=" 500 687.5, 500 812.5, 662.375 718.75, 662.375 781.25, 500 875, 500 1000, 770.625  843.75, 770.625  531.25"
                data-reactid="10"
              />
              <polyline
                fill="white"
                points=" 500 875, 500 1000, 67 750, 67 625"
                data-reactid="11"
              />
              <polyline
                fill="white"
                points=" 500 500, 500 625, 175.25 437.5, 175.25 500, 500 687.5, 500 812.5, 67 562.5, 67 250 "
                data-reactid="12"
              />
              <text x="1300" y="725" fill="white" opacity="1" fontSize="600">
                Software Mansion
              </text>
            </svg>
          </a>
        </div>
      </footer>
    );
  }
}

module.exports = Footer;
